package test3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-02-01
 * Time: 15:08
 */
abstract class Animal{
    protected String name;
    public Animal(String name){
        this.name = name;
    }
    protected void makeSound(){
        System.out.println("发出声音");
    }
}
class Cat extends Animal{
    public int age;
    public Cat(String name , int age){
        super(name);
        this.age = age;
    }

    @Override
    public void makeSound() {
        System.out.println("喵喵~~~");
    }
}
public class Test2 {
}
